from IO import *

def week():
    a_week = input("如果课程区分单双周请输入1，否则输入0")
    if a_week==1:
        a_week = "单"
    week_s = input("请输入课程开始时间（周）")
    week_e = input("请输入课程结束时间（周）")
    week = "{}-{}周({})".format(week_s, week_e, a_week)
    return week

def parts():
    parts = input("请输入课程开始于（节）")
    parte = input("请输入课程结束于（节）")
    part = "{}-{}".format(parts, parte)
    return part

def add(cls=Classes()):
    name = input("请输入课程名")
    day = eval(input("请输入课程在星期几"))
    weeks = week()
    part = parts()
    teacher = input("请输入任课老师")
    address = input("请输入地址")
    cl = AClass(name, day, weeks, part, teacher, address)
    cls.append(cl)


def change(cls=Classes()):
    print("########################################################")
    print("课程列表")
    index = 0
    for cl in cls:
        print(index,"-",cl["name"],"*",cl[id])
    print("########################################################")
    command = input("请输入你想修改的课程")
    cid = list(cls)[command]
    name = cls[cid]["name"]
    day = cls[cid]["day"]
    week = cls[cid]["week"]
    name = cls[cid]["name"]
    name = cls[cid]["name"]
    name = cls[cid]["name"]
    command = input("请输入您想修改的内容\n0-课程名\t1-星期几\t2-课程周\t3-课程节\t4-任课老师\t5-地址")
    if command == 0:
        name = input()
    elif command == 1:
        day = eval(input())
    elif command == 2:
        weeks = week()
    elif command == 3:
        part = parts()
    elif command == 4:
        teacher = input()
    elif command == 5:
        address = input()
    cl = AClass(name, day, weeks, part, teacher, address)
    cls.append(cl)


def delete():
    pass


def operator():
    command = input("输入0管理日期，输入1管理课程")
    if command:
        command = input("输入0导入课程，输入1新增课程，输入2修改课程，输入3删除课程")
        if command == 0:
            command = input("请将js粘贴到此处")
        elif command == 1:
            add()
        elif command == 2:
            change()
        elif command == 3:
            delete()
    else:
        date = []
        command = input("设置开学年")
        date.append(command)
        command = input("设置开学月")
        date.append(command)
        command = input("设置开学日")
        date.append(command)